﻿using System.Collections.Generic;

namespace Utilities.Structures
{
    public class TreeNode<T>
    {
        public virtual T Value { get; set; }
        public List<TreeNode<T>> Childs;
        public TreeNode<T> Parent;

        public TreeNode(T value) : this(null, value)
        {
        }
        public TreeNode(TreeNode<T> parent, T value)
        {
            Value = value;
            Childs = new List<TreeNode<T>>();
            Parent = parent;
        }

        public override string ToString()
        {
            return Value == null ? "null" : Value.ToString();
        }
    }
}
